#include <stdio.h>
#include <string.h>

// 构造一个类Csingleton，使该类只能存在一个实例。

class Csingleton
{
public:
    static Csingleton *getInstance()
    {
        if (m_pInstance == NULL)
        {
            m_pInstance = new Csingleton();
        }
        return m_pInstance;
    }
    void print()
    {
        printf("hello world\n");
    }

    Csingleton(const Csingleton &) = delete;
    Csingleton &operator=(const Csingleton &) = delete;

private:
    Csingleton()
    {
        printf("Csingleton\n");
    }
    static Csingleton *m_pInstance;
};